<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>养护管理</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../css/style.css" />
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
		<style>
			html, body {
				background-color: #F5F6F6;
			}
			ul {
				position: relative;
				width: 100%;
			}
			ul li {
				list-style: none;
			}
			ul li input {
				display: none;
			}
			ul li label {
				float: left;
				width: 33.3%;
				text-align: center;
				line-height: 34px;
				height: 35px;
				border-right: 0;
				box-sizing: border-box;
				cursor: pointer;
				transition: all .3s;
				background-color: #1abc9c;
				color: #fff;
			}
			ul li input:checked+ label {
				color: #000;
				background-color: #F5F6F6;
			}
			ul li:last-child label {
				border-right: 1px solid #1abc9c;
			}
			ul li .content {
				opacity: 0;
				visibility: hidden;
				position: absolute;
				left: 0;
				top: 31px;
				width: 100%;
				height: auto;
				box-sizing: border-box;
				transition: all .3s;
			}
			ul li .content table {
				width: 100%
			}
			ul li .content td {
				border-bottom: 1px solid #DFE0E0;
				height: 60px;
			}
			ul li .content td:nth-child(1) {
				padding-left: 10px;
			}
			ul li .content td:nth-child(1) p:nth-child(2) {
				color: #555555
			}
			ul li:nth-child(1) .content {
				background-color: #F5F6F6;
			}
			ul li:nth-child(2) .content {
				background-color: #F5F6F6;
			}
			ul li:nth-child(3) .content {
				background-color: #F5F6F6;
			}
			ul li:nth-child(4) .content {
				background-color: #F5F6F6;
			}
			ul li input:checked~
			.content {
				opacity: 1;
				visibility: visible;
			}
			.content {
				opacity: 1;
				visibility: visible;
			}
			.Add {
				height: 40px;
				width: 96%;
				background-color: #1ABC9C;
				color: white;
				text-align: center;
				font-size: 15px;
				margin-top: 20px;
				outline: none;
			}
			ol, ul {
				margin-top: 0;
				margin-bottom: 0;
			}
			.aa {
				width: 45%;
				height: 30px;
				float: left;
				font-size: 18px;
				background-color: #FFFFFF;
			}
			.ab {
				width: 100%;
				color: #797979;
				float: left;
				margin-top: 5px
			}
			.ab span {
				margin-left: 30px;
				font-size: 16px
			}
		</style>
	</head>
	<body>
		<ul>
			<li>
				<input id="tab1" type="radio" name="tab" checked>
				<label for="tab1">日报信息</label>
				<div class="content" id="jc">
					<div   v-for="(dete, index) in lnsectdetection" style="background-color: rgb(240,239,244);margin-top: 10px;height: 110px">
						<div style="width: 10%;height: 30px;float: left;background-color: #FFFFFF;">
							<img src="../image/gzjh.png" style="width:20px;height: auto;margin-top: 5px;margin-left: 10px"/>
						</div>
						<div class="aa">
							<span style="margin-top: 5px;margin-left:5px;font-size: 13px" v-text="dete.d_name.slice(0,15)+'...'" v-if="dete.d_name.length>15"></span>
							<span style="margin-top: 5px;margin-left:5px;font-size: 13px" v-text="dete.d_name" v-else></span>
						</div>
						<div class="aa" style=";text-align: right;" v-on:click="daily(dete.id,dete.d_name,dete.d_speed)">
							<span style="margin-right: 10px;color: #00bbd4;margin-top: 5px;font-size: 13px">查看详情  ></span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">日报计划日期：{{dete.d_createDate}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">添加人员：{{dete.d_aname}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">进度完成等级：{{dete.d_speed}}</span>
						</div>
					</div>
				</div>
				<!--		<div class="content" id="jc" v-cloak>
				<div v-for="(dete, index) in lnsectdetection"
				style="background-color: rgb(240,239,244);margin-top: 10px;height: 110px">
				<div style="width: 10%;height: 30px;float: left;background-color: #FFFFFF;">
				<img src="../image/treeac.png"
				style="width:20px;height: auto;margin-top: 5px;margin-left: 20px" />
				</div>
				<div class="aa">
				<span
				style="margin-top: 5px;margin-left:5px" v-text="'日报计划名称:  '+dete.d_name.slice(0,15)+'...'" v-if="dete.d_name.length>15"></span>
				<span
				style="margin-top: 5px;margin-left:5px" v-text="dete.d_name" v-else></span>
				</div>
				<div class="cc" style="text-align: right;" v-on:click="daily(dete.id,dete.d_name,dete.d_speed)">
				<span style="margin-right: 10px;color: #00bbd4;margin-top: 5px;font-size: 13px">查看详情
				></span>
				</div>
				<div class="ab"><span style="font-size: 13px" v-text="'日报计划日期:  '+dete.d_createDate"></span></div>
				<div class="ab">
				<span  style="font-size: 13px" v-text="'添加人员:  '+dete.d_aname"></span>
				</div>
				<div class="ab"><span  style="font-size: 13px" v-text="'进度完成等级:  '+dete.d_speed"></span></div>
				</div>
				</div>
				-->
				<!--<div class="content">
				<table id="jc">
				<tr v-for="(dete,index) in lnsectdetection">
				<td>
				<p v-text="dete.d_name.slice(0,15)+'...'" v-if="dete.d_name.length>15"></p>
				<p v-text="dete.d_name" v-else></p>
				<p v-text="dete.d_createDate"></p>
				</td>
				<td width="100">
				<p v-text="dete.d_aname"></p>
				<p v-text="dete.d_speed"></p>
				</td>
				<td width="50"><img src="../image/update.png" height="55%" @click="daily(dete.id,dete.d_name,dete.d_speed)" /></td>
				</tr>
				</table>
				</div>-->
			</li>
			<li>
				<input id="tab2" type="radio" name="tab">
				<label for="tab2">周报信息</label>
				<div class="content" id="ls">
					<div   v-for="(insecth, index) in lnsecthistory" style="background-color: rgb(240,239,244);margin-top: 10px;height: 115px">
						<div style="width: 10%;height: 30px;float: left;background-color: #FFFFFF;">
							<img src="../image/gzjh.png" style="width:20px;height: auto;margin-top: 5px;margin-left: 10px"/>
						</div>
						<div class="aa">
							<span style="margin-top: 6px;margin-left:5px;font-size: 13px" v-text="insecth.d_name.slice(0,15)+'...'" v-if="insecth.d_name.length>15"></span>
							<span style="margin-top: 6px;margin-left:5px;font-size: 13px" v-text="insecth.d_name" v-else></span>
						</div>
						<div class="aa" style=";text-align: right;" v-on:click="daily(insecth.id,insecth.d_name,insecth.d_speed)">
							<span style="margin-right: 10px;color: #00bbd4;margin-top: 5px;font-size: 13px">查看详情  ></span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">周报计划日期：{{insecth.d_createDate}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">添加人员：{{insecth.d_aname}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">进度完成等级：{{insecth.d_speed}}</span>
						</div>
					</div>
				</div>
				<!--
				<div class="content">
				<table id="ls">
				<tr v-for="(insecth,index) in lnsecthistory">
				<td>
				<p v-text="insecth.d_name.slice(0,15)+'...'" v-if="insecth.d_name.length>15"></p>
				<p v-text="insecth.d_name" v-else></p>
				<p v-text="insecth.d_createDate"></p>
				</td>
				<td width="100">
				<p v-text="insecth.d_aname"></p>
				<p v-text="insecth.d_speed"></p>
				</td>
				<td width="50"><img src="../image/update.png" height="55%" @click="daily(insecth.id,insecth.d_name,insecth.d_speed)" /></td>
				</tr>
				</table>
				</div>-->
			</li>
			<li>
				<input id="tab3" type="radio" name="tab">
				<label for="tab3">月计划</label>
				<div class="content" id="modes">
					<div   v-for="(m, index) in modes" style="background-color: rgb(240,239,244);margin-top: 10px;height: 115px">
						<div style="width: 10%;height: 30px;float: left;background-color: #FFFFFF;">
							<img src="../image/gzjh.png" style="width:20px;height: auto;margin-top: 5px;margin-left: 10px"/>
						</div>
						<div class="aa">
							<span style="margin-top: 6px;margin-left:5px;font-size: 13px" v-text="m.d_name.slice(0,15)+'...'" v-if="m.d_name.length>15"></span>
							<span style="margin-top: 6px;margin-left:5px;font-size: 13px" v-text="m.d_name" v-else></span>
						</div>
						<div class="aa" style=";text-align: right;" v-on:click="daily(insecth.id,insecth.d_name,insecth.d_speed)">
							<span style="margin-right: 10px;color: #00bbd4;margin-top: 5px;font-size: 13px">查看详情  ></span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">月报计划日期：{{m.d_createDate}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">添加人员：{{m.d_aname}}</span>
						</div>
						<div class="ab">
							<span style="font-size: 13px">进度完成等级：{{m.d_speed}}</span>
						</div>
					</div>
				</div>
				<!--<div class="content">
				<table id="modes">
				<tr v-for="(m,index) in modes">
				<td>
				<p v-text="m.d_name.slice(0,15)+'...'" v-if="m.d_name.length>15"></p>
				<p v-text="m.d_name" v-else></p>
				<p v-text="m.d_createDate"></p>
				</td>
				<td width="100">
				<p v-text="m.d_aname"></p>
				<p v-text="m.d_speed"></p>
				</td>
				<td width="50"><img src="../image/update.png" height="55%" @click="daily(m.id,m.d_name,m.d_speed)" /></td>
				</tr>
				</table>
				</div>-->
			</li>
		</ul>
	</body>
</html>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript">
	//項目id
	// var departid = $api.getStorage('selectpor').id;
	var departid = null;
	var reg = $api.getStorage("userSession");
	var sids = reg.data.sysRole.sysRoleCode;
	var role = sids.role_number;
	if (role != "construction") {
		departid = $api.getStorage("selectpor").id;
	} else {
		departid = reg.data.areaid;
	}
	//用户id
	var userid = $api.getStorage('userSession').data.id;
	////企业id
	var qiyeid = $api.getStorage('userSession').data.enterprise.id;
	apiready = function() {
		//日计划
		var apps = new Vue({
			el : '#jc',
			data : {
				lnsectdetection : []
			},
			created : function() {
				$.ajax({
					type : "post",
					//async : false, //同步执行
					url : serverIP + "mobile/work_plan_day/findAll.json",
					data : {
						d_eid : qiyeid,
						d_area_id : departid,
						page : 0,
						limit : 99999
					},
					dataType : "json", //返回数据形式为json
					success : function(result) {
						//	alert(JSON.stringify(result));
						if (result != null) {
							for (var i = 0; i < result.data.length; i++) {
								apps.lnsectdetection.push(result.data[i])
							}
						}
					},
					error : function(eer) {
						alert(JSON.stringify(eer))
					}
				});
			},
			methods : {
				daily : function(i, name, scom) {
					api.openWin({
						name : 'wss',
						url : 'tailedre_window.html',
						rect : {
							x : 0,
							y : 0,
							w : 'auto',
							h : 'auto'
						},
						pageParam : {
							id : i,
							name : name,
							scom : scom
						}, //传递参数
						bounces : true,
						delay : 200
					});
					/* 		$.ajax({
					 type: "post",
					 //async : false, //同步执行
					 url: BaseServiceUrl + "app/data/viewandimage.json",
					 data: {
					 id: id
					 },
					 dataType: "json", //返回数据形式为json
					 success: function (result) {
					 api.openWin({
					 name: 'wss',
					 url: 'tailedre_window.html',
					 rect: {
					 x: 0,
					 y: 0,
					 w: 'auto',
					 h: 'auto'
					 },
					 pageParam: {
					 result: result,
					 id: id
					 }, //传递参数
					 bounces: true,
					 delay: 200
					 });
					 }
					 }); */
				}
			}
		})
		//周计划
		var app = new Vue({
			el : '#ls',
			data : {
				lnsecthistory : []
			},
			created : function() {
				$.ajax({
					type : "post",
					//async : false, //同步执行
					url : serverIP + "mobile/work_plan_week/findAll.json",
					data : {
						d_eid : qiyeid,
						d_area_id : departid,
						page : 0,
						limit : 99999
					},
					dataType : "json", //返回数据形式为json
					success : function(result) {
						//alert(JSON.stringify(result));
						if (result != null) {
							for (var i = 0; i < result.data.length; i++) {
								//alert(result.data[i])
								app.lnsecthistory.push(result.data[i])
							}
						}
					}
				});
			},
			methods : {
				daily : function(i, name, scom) {
					api.openWin({
						name : 'wss1',
						url : 'tailedre_window1.html',
						rect : {
							x : 0,
							y : 0,
							w : 'auto',
							h : 'auto'
						},
						pageParam : {
							id : i,
							name : name,
							scom : scom
						}, //传递参数
						bounces : true,
						delay : 200
					});
				}
			}
		})
		//月计划
		var appss = new Vue({
			el : '#modes',
			data : {
				modes : []
			},
			created : function() {
				$.ajax({
					type : "post",
					//async : false, //同步执行
					url : serverIP + "mobile/work_plan_month/findAll.json",
					data : {
						d_eid : qiyeid,
						d_area_id : departid,
						page : 0,
						limit : 99999
					},
					dataType : "json", //返回数据形式为json
					success : function(result) {
						//alert(JSON.stringify(result));
						if (result != null) {
							for (var i = 0; i < result.data.length; i++) {
								//alert(result.data[i])
								appss.modes.push(result.data[i])
							}
						}
					}
				});
			},
			methods : {
				daily : function(i, name, scom) {
					api.openWin({
						name : 'wss2',
						url : 'tailedre_window2.html',
						rect : {
							x : 0,
							y : 0,
							w : 'auto',
							h : 'auto'
						},
						pageParam : {
							id : i,
							name : name,
							scom : scom
						}, //传递参数
						bounces : true,
						delay : 200
					});
				}
				/* 				daily: function (id) {
				 api.openWin({
				 name: 'wss',
				 url: 'tailedre_window2.html',
				 rect: {
				 x: 0,
				 y: 0,
				 w: 'auto',
				 h: 'auto'
				 },
				 pageParam: {
				 id: id
				 }, //传递参数
				 bounces: true,
				 delay: 200
				 });
				 } */
			}
		})
	}; 
</script>